package 货币系统2;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static int N = 25010, M = 110;
    static boolean[] st = new boolean[N];
    static int[] a = new int[M];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while (T-- > 0) {
            int n = in.nextInt();
            for (int i = 1; i <= n; i++) {
                a[i] = in.nextInt();
            }
            Arrays.fill(st, false);
            st[0] = true;
            Arrays.sort(a, 1, n + 1);
            int res = 0, m = a[n];
            for (int i = 1; i <= n; i++) {
                if (!st[a[i]]) {
                    res++;
                }
                for (int j = a[i]; j <= m; j++) {
                    st[j] |= st[j - a[i]];
                }
            }
            System.out.println(res);
        }
    }
}
